<template>
  <div class="app-container" style="padding: 20px">
    <div style="width: 40%">
      <el-form :mode="systemInfo" label-width="120px">
        <el-form-item label="系统名称">
          <el-input v-model="systemInfo.sysname"></el-input>
        </el-form-item>
        <el-form-item label="系统标题">
          <el-input v-model="systemInfo.sysdiagram"></el-input>
        </el-form-item>
        <el-form-item label="主服务器IP地址">
          <el-input v-model="systemInfo.serverip"></el-input>
        </el-form-item>
        <el-form-item label="系统等级">
          <el-input v-model="systemInfo.syslevel"></el-input>
        </el-form-item>
        <el-form-item label="数据库版本">
          <el-input v-model="systemInfo.dbversion"></el-input>
        </el-form-item>
        <el-form-item label="存储周期">
          <el-select v-model="systemInfo.savecyc" placeholder="请选择">
            <el-option label="5秒" value="5"></el-option>
            <el-option label="10秒" value="10"></el-option>
            <el-option label="15秒" value="15"></el-option>
            <el-option label="20秒" value="20"></el-option>
            <el-option label="30秒" value="30"></el-option>
            <el-option label="60秒" value="60"></el-option>
            <el-option label="120秒" value="120"></el-option>
            <el-option label="180秒" value="180"></el-option>
            <el-option label="300秒" value="300"></el-option>
            <el-option label="600秒" value="600"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="参数更新标志">
          <el-input v-model="systemInfo.updateflag"></el-input>
        </el-form-item>
      </el-form>
      <div style="float: right">
        <el-button @click="saveInfo"> 保存 </el-button>
      </div>
    </div>
  </div>
</template>
<script>
import request from "@/utils/request";
export default {
  data() {
    return {
      systemInfo: {},
    };
  },
  created() {
    request({
      url: "/api/cmsApi/getSystemInfo",
      method: "get",
    }).then((res) => {
      console.log("result", res);
      this.systemInfo = res.data;
    });
  },
  methods: {
    saveInfo() {
      request({
        url: "/api/cmsApi/updateSystemInfo",
        method: "put",
        data: this.systemInfo,
      }).then((res) => {
        this.$message.success("保存成功");
      });
    },
  },
};
</script>
